{include file='pub/header'/}
<title>订单列表</title>
</head>

<body class="pos-r">
<nav class="breadcrumb">{$breadNav} <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px"
                                       href="javascript:location.replace(location.href);" title="刷新"><i
        class="Hui-iconfont">&#xe68f;</i></a></nav>
    <div class="page-container">
        <div class="mt-20">
            <table class="table table-border table-bordered table-bg table-hover table-sort">
                <thead>
                <tr class="text-c">
                    <th width="50">订单编号</th>
                    <th width="60">下单时间</th>
                    <th width="60">下单客户</th>
                    <th width="30">订单状态</th>
                    <th width="30">支付方式</th>
                    <th width="30">商品总金额</th>
                    <th width="30">运费</th>
                    <th width="60">支付总金额</th>
                    <th width="60">配送时间</th>
                    <th width="100">操作</th>
                </tr>
                </thead>
                <tbody>
                {foreach $list as $item}
                <tr class="text-c va-m">
                    <td>{$item.order_no}</td>
                    <td>{$item.create_time}</td>
                    <td>{$item.user_name}</td>
                    <td>
                        {:config('order_status')[$item.order_status]}
                    </td>
                    <td>{:config('pay_type')[$item.pay_type]}</td>
                    <td>{$item.total_money}</td>
                    <td>{$item.send_fee}</td>
                    <td>{$item.order_money}</td>
                    <td>{$item.send_time}</td>
                    <td class="td-manage">
                        {if $item.order_status eq 1 and $item.is_send eq 0}
                        <a style="text-decoration:none" class="ml-5" onClick="order_send('{$item.order_no}')"
                           href="javascript:;" title="发货">
                            <i class="Hui-iconfont">&#xe623;</i>发货
                        </a>
                        {/if}
                        <a style="text-decoration:none" class="ml-5" onClick="order_detail('{$item.id}')"
                           href="javascript:;" title="订单详情">
                            <i class="Hui-iconfont">&#xe623;</i>订单详情
                        </a>
                    </td>
                </tr>
                {/foreach}
                </tbody>
            </table>
        </div>
    </div>

{include file='pub/footer'/}
<script type="text/javascript">
    $('.table-sort').dataTable({
        "aaSorting": [[1, "desc"]],//默认第几个排序
        "bStateSave": false,//状态保存
        "aoColumnDefs": [
            {"orderable": false, "aTargets": [8]}// 制定列不参与排序
        ],
    });

    //订单详情
    function order_detail(order_id) {
        layer_show('订单详情', "{:url('Order/order_detail')}?order_id=" + order_id);

    }

    //订单配送
    function order_send(order_no) {
        layer_show('订单详情', '{:url("orderSend")}?order_no='+order_no);
    }

    //确认收获
    function sure_order(o, order_id) {
        layer.confirm("确认收获？", function () {
            $.post("{:url('sure_order')}", {'order_id': order_id}, function (res) {
                if (res.code == 1) {
                    location.reload();
                } else {
                    layer.msg(res.msg);
                }

            });
        });
    }

</script>
</body>
</html>